package gameEngine.agents.choosingStrategy;


import java.util.ArrayList;

import org.apache.log4j.Logger;

import gameEngine.agents.teamMateModel.AgentMock;
import gameEngine.agents.teamMateModel.TeamMateModel;
/**
 * simple random at each turn
 * @author alon
 *
 */
public class SimpleRandomStrategy implements ChoosingStrategy {
	/**
	 * returns an id of a random agent
	 */
	Logger log = Logger.getLogger(this.getClass());
	
	public int chooseNextPlayer(TeamMateModel teamMateModel) {
		int rnd=(int)(Math.random()*teamMateModel.getTeamMates().size());
		ArrayList<AgentMock> agents=new ArrayList<AgentMock>();
		agents.addAll(teamMateModel.getTeamMates());
		int agent=agents.get(rnd).getId();
		log.debug("reandom choose agent "+agent);
		return agent;
	}

	public SimpleRandomStrategy clone(){
		return new SimpleRandomStrategy();
	}
}
